const data = [
  ["2000-06-01", 57],
  ["2000-06-02", 55],
  ["2000-06-03", 125],
  ["2000-06-04", 83],
  ["2000-06-05", 116],
  ["2000-06-06", 129],
  ["2000-06-07", 135],
  ["2000-06-08", 86],
  ["2000-06-09", 73],
  ["2000-06-10", 85],
  ["2000-06-11", 73],
  ["2000-06-12", 68],
  ["2000-06-13", 92],
  ["2000-06-14", 130],
  ["2000-06-15", 245],
  ["2000-06-16", 139],
  ["2000-06-17", 115],
  ["2000-06-18", 111],
  ["2000-06-19", 309],
  ["2000-06-20", 206],
  ["2000-06-21", 137],
  ["2000-06-22", 128],
  ["2000-06-23", 85],
  ["2000-06-24", 94],
  ["2000-06-25", 71],
  ["2000-06-26", 106],
  ["2000-06-27", 84],
  ["2000-06-28", 93],
  ["2000-06-29", 85],
  ["2000-06-30", 73],
];

const dateList = data.map(function (item) {
  return item[0];
});
const valueList = data.map(function (item) {
  return item[1];
});
const valueList2 = valueList.map((item: any) => {
  return item - Math.ceil(Math.random() * 120)
})

export default {
  radar: {
    grid: {
    },
    radar: {
      // shape: 'circle',
      name: {
        textStyle: {
          color: '#fff',
          backgroundColor: '#999',
          borderRadius: 3,
          padding: [3, 5]
        }
      },
      indicator: [
        {name: 'IPTV', max: 6500},
        {name: 'Android', max: 1600},
        {name: 'IOS', max: 3000},
        {name: 'Android Pad', max: 3800},
        {name: 'iPad', max: 5200},
        {name: 'PC', max: 2500},
        {name: 'Mac', max: 2500}
      ]
    },
    series: [{
      name: '预算 vs 开销',
      type: 'radar',
      // areaStyle: {normal: {}},
      data: [
        {
          value: [4300, 1000, 2800, 3500, 5000, 1900],
          name: '预算分配（Allocated Budget）'
        },
        {
          value: [5000, 1400, 2800, 3100, 4200, 2100],
          name: '实际开销（Actual Spending）'
        }
      ]
    }]
  },
  line: {
    animationDuration: 1000,
    grid: {
    },
    tooltip: {
      trigger: 'axis'
    },
    xAxis: {
      data: dateList
    },
    yAxis: {
    },
    series: [
      {
        type: 'line',
        showSymbol: false,
        data: valueList,
        smooth: true,
        lineStyle: {
          color: '#10B981'
        }
      },
      {
        type: 'line',
        showSymbol: false,
        data: valueList2,
        smooth: true,
        lineStyle: {
          color: '#EF4444'
        }
      },
    ]
  },
  map: {
    grid: {
      y: 20,
      y2: 20
    },
    series: [{
      type: 'map',
      map: 'china',
      geo: {
        map: "china",
        roam: true, //开启鼠标缩放和漫游
        zoom: 1, //地图缩放级别
        top: 0,
        bottom: 0,
        layoutCenter: ["50%", "30%"],
        label: {
          show: true,
          fontSize: 10,
          color: "#ceac09"
        }
      },
      itemStyle: {
        shadowColor: 'rgba(255, 255, 255, 0.5)',
        shadowBlur: 1,
        borderColor: '#BDE7FF',
        areaColor: '#4778db'
      }
    }],
    legend: {
      data: ['正常', '告警', '错误']
    }
  },
  bar: {
    grid: {
      top: '10%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        axisTick: {show: false},
        data: ['2012', '2013', '2014', '2015', '2016']
      }
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: [
      {
        name: 'Forest',
        type: 'bar',
        barGap: 0,
        emphasis: {
          focus: 'series'
        },
        data: [320, 332, 301, 334, 390]
      },
      {
        name: 'Steppe',
        type: 'bar',
        emphasis: {
          focus: 'series'
        },
        data: [220, 182, 191, 234, 290]
      },
      {
        name: 'Desert',
        type: 'bar',
        emphasis: {
          focus: 'series'
        },
        data: [150, 232, 201, 154, 190]
      },
      {
        name: 'Wetland',
        type: 'bar',
        emphasis: {
          focus: 'series'
        },
        data: [98, 77, 101, 99, 40]
      }
    ]
  },
  table: {
    data: ['北京', '上海', '天津', '重庆', '广东', '江苏', '内蒙', '贵州', '新疆', '云南', '四川', '其他'].map(item => {
      return {
        area: item, subscribe: Math.ceil(Math.random() * 1000 + 10), unsubscribe: Math.ceil(Math.random() * 10 + 10)
      }
    }).sort((a, b) => b.subscribe - a.subscribe),
    column: [
    ]
  }
}
